﻿<?php
class Game
{
	private $name;
	private $developer_id;
	private $developer;
	private $os;
	public function __construct($name, $os, $developer_id)
	{
		$this->name = $name;
		$this->os = $os;
		$this->developer_id = $developer_id;
	}
	
	public static function exist($name)
	{
		global $mustangDB;
		$mustangDB->query("select * from t_game where name = '" . 
			mysql_real_escape_string($name) .
			"'");
		return $mustangDB->count();
	}
	
	public function save()
	{
		global $mustangDB;
		$mustangDB->query("insert into t_game(name, os, developer_id) values('" . 
			mysql_real_escape_string($this->name) . 
			"','" .
			mysql_real_escape_string($this->os) . 
			"'," .
			mysql_real_escape_string($this->developer_id) . 
			")");
	}
}
?>